package com.yutian.endecryption.mock.mapper;

import com.yutian.endecryption.mock.sql.MockDataSqlProvider;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * 清除相关伪数据
 *
 * @author zhang peng yang ming
 * @create 2017-08-04 10:25
 */
public interface MockDataMapper {
    @DeleteProvider(type = MockDataSqlProvider.class, method = "delete")
    int delete(@Param("ksySfzmhm") String ksySfzmhm, @Param("ksyName") String ksyName, @Param("detailDlr") String detailDlr);

    @DeleteProvider(type = MockDataSqlProvider.class, method = "deleteUplodeSignItem")
    int deleteUplodeSignItem(@Param("vtUploadSfzmhm") String vtUploadSfzmhm, @Param("sfzmhm") String sfzmhm);

    @Select("SELECT sfzmhm FROM vt_examinee_info WHERE ksy1=#{ksyName};")
    List<String> retrieveMockExamniee(String ksyName);

    void deleteSifnInfo(List<String> sfzmhms);

    @Select("SELECT sfzmhm FROM vt_examinee_info WHERE ksy1=#{ksy1}")
    List<String> getAllMockExamineeId(String ksy1);
    @Insert("INSERT INTO vt_sign_in_info (sign_photo, finger, carnum, examstate, language, sfzmhm, sign_time) VALUES (#{sign_photo}, #{finger}, 0, 3, 0, #{sfzmhm}, #{sign_time});")
    int insertSignInfo(@Param("sign_photo") String sign_photo,
                       @Param("finger") String finger,
                       @Param("sfzmhm") String sfzmhm,
                       @Param("sign_time") Date sign_time);
}
